package com.cloudfun.campusshare.common.constant;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/5/12 14:08
 * @description :
 */
public enum ReportFormTimeFilter {
    SELF_MONTH(1,"本月"),
    HALF_YEAR(2,"近半年"),
    TOTAL_YEAR(3,"近一年"),

    TODAY(4,"今天"),
    IN_SEVEN_DAY(5,"近七天"),
    IN_MONTH(6,"近三十天"),
    THREE_MONTH(8,"近三个月"),
    SIX_MONTH(9,"近六个月"),
    TWELVE_MONTH(10,"近一年"),
    YESTER_DAY(7,"昨天");
    private int code;
    private String message;

    ReportFormTimeFilter(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static ReportFormTimeFilter getByCode(Integer code){
        if(code == null){
            return null;
        }
        ReportFormTimeFilter[] values = ReportFormTimeFilter.values();
        for(ReportFormTimeFilter r : values){
            if(r.code == code.intValue()){
                return r;
            }
        }
        return null;
    }
}
